//全局随机数重写
const random = Math.random;
Math.random = (a = 0, b = 1, c = 6) => {
	return (random() * (b - a) + a).toFixed(c) - 0;
};
//全局重写四舍五入函数 可传入保留位数
const round = Math.round;
Math.round = (a = 0, b = 0) => {
	b = b - 0 || 0;
	const m = Math.pow(10, b);
	return round(a * m) / m;
}
//数组去重
Array.prototype.setArray = function() {
	return Array.from(new Set(this));
}

import Vue from 'vue'
import App from './App'
import store from './store'

//全局事件
Vue.prototype.$BusEvent = new Vue();

import Vconsole from 'vconsole'
export default new Vconsole()

Vue.config.productionTip = false
Vue.prototype.$store = store

import api from '@/common/vmeitime-http/teacher_http.js'
Vue.prototype.$api = api;
import http from '@/common/vmeitime-http/interface.js'
Vue.prototype.$http = http;

Vue.directive('title', {
  inserted: function (el, binding) {
    document.title = el.dataset.title
  }
})

App.mpType = 'app'

const app = new Vue({
	store,
	...App
})
app.$mount()
